//
//  MainTabbarController.swift
//  viewcontroller_test
//
//  Created by 曾思宇 on 16/4/2.
//  Copyright © 2016年 海南开工信息技术有限公司. All rights reserved.
//

import UIKit

class MainTabbarController: UITabBarController {
    
    static var mainViewController: UIViewController?

    override func viewDidLoad() {
        super.viewDidLoad()

        if MainTabbarController.mainViewController == nil {
            MainTabbarController.mainViewController = self
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    
    override func willMoveToParentViewController(parent: UIViewController?) {
        
        //super.willMoveToParentViewController(parent)
        
        if let navController = parent as? UINavigationController {
            navController.navigationBarHidden = true
        }
    }
    
    override func viewWillAppear(animated: Bool) {
        
        // 确保不会显示
        if let navController = navigationController {
            navController.navigationBarHidden = true
        }
    }

}
